package grailsforum

class CoursesController {

    def index() {

        [courses : Course.findAll()]
    }

    def view(){

        def c = Course.get(params.id)

        if(c){
            [course: c]
        }
        else{
            redirect action: 'index'
        }
    }
}
